import Home from '../views/Home.vue'
export default [
    {
        path: '/',
        name: 'Home',
        component: Home,
        beforeEnter: ((to, from, next) => {
            if (from.name === 'About') alert('这是从about页跳转过来的')
            else alert('这不是从about页面来的')
            next()
        }),
        meta: {
            title: '首页'
        }
    },
    {
        path: '/about',
        name: 'About',
        component: () => import(/* webpackChunkName: "about" */ '../views/About.vue'),
        meta: {
            title: '关于'
        },
        beforeEnter: ((to, from, next) => {
            console.log(from.meta)
            next()
        })
    },
    {
        path: '/argu/:name',
        component: () => import('@/views/argu.vue')
    },
    {
        path: '/login',
        name:'login',
        component: () => import('@/views/login.vue')
    },
    {
        path: '/countTo',
        name: 'countTo',
        component: () => import('@/views/count.vue')
    },
    {
        path: '/split-pane',
        name: 'split-pane',
        component: () => import('@/views/split')
    },
    {
        path: '/render',
        name: 'Render',
        component: () => import('@/views/render_dom')
    },
    {
        path: '/menu-page',
        name: 'menu-page',
        component: () => import('@/views/menu-page')
    },
    //配置404页面
    {
        path: '*',
        component: () => import('@/views/error_404.vue')
    }
]